<script setup>
   import { ref } from 'vue';
   import { useRoute , useRouter } from 'vue-router';

   let id = ref(0);
   let name =ref("");

   // useRoute 创建的对象可以接收参数不能跳转
   // 接收query参数: 1.useRoute() 获取当前的路由对象 2. route.query.参数名即可 
   let route = useRoute();
   id.value = route.query.id;
   name.value = route.query.name;

   //调回去
   let router = useRouter();
   let goBack = ()=>{
     router.push("/query/from");
   }


</script>

<template>
  <div>
        {{ id}} ::: {{name}}
        <br>
        <button @click="goBack()">返回</button>
  </div>
</template>

<style scoped>

</style>